getApp();

Page({
    data: {
        parties: {},
        bol: !1
    },
    onLoad: function() {
        wx.getStorageSync("parties").c1 && this.setData({
            bol: !0
        });
    },
    onReady: function() {
        var _ = this;
        wx.getStorage({
            key: "parties",
            success: function(t) {
                _.setData({
                    parties: t.data
                });
            }
        });
    },
    table: function() {
        wx.redirectTo({
            url: "../SdrafTable/SdrafTable"
        });
    },
    partysubmit: function(_) {
        var t = this.data.bol, a = _.detail.value;
        a.a1 || (a.a1 = "________________________"), a.a2 || (a.a2 = "________________________"), 
        a.a3 || (a.a3 = "_____________________"), a.b1 || (a.b1 = "________________________"), 
        a.b2 || (a.b2 = "________________________"), a.b3 || (a.b3 = "_____________________"), 
        1 == t && (a.c1 || (a.c1 = "________________________"), a.c2 || (a.c2 = "________________________"), 
        a.c3 || (a.c3 = "_____________________")), wx.setStorageSync("parties", a), wx.redirectTo({
            url: "../SdrafTable/SdrafTable"
        });
    },
    Addpartc: function() {
        var _ = this.data.bol, t = this.data.parties, a = t.c1;
        if (a || this.setData({
            bol: !_
        }), a) {
            var e = this;
            wx.showModal({
                title: "提示",
                content: "确定要删除”丙方“吗？",
                success: function(a) {
                    a.confirm && (e.setData({
                        bol: !_,
                        "parties.c1": "",
                        "parties.c2": "",
                        "parties.c3": ""
                    }), wx.setStorageSync("parties", t), wx.removeStorage({
                        key: "obligc"
                    }));
                }
            });
        }
    },
    Reset: function() {
        var _ = this;
        wx.showModal({
            title: "提示",
            content: "重置将消除已填写的签约人信息，确定要重置吗？",
            success: function(t) {
                t.confirm && (_.setData({
                    parties: ""
                }), wx.removeStorage({
                    key: "parties"
                }));
            }
        });
    }
});